<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <h1>注册</h1>
    用户名：<input type="text" v-model="user.yhm"><br>
    密码：<input type="password" v-model="user.mm"><br>
    确认密码：<input type="password" v-model="user.qrmm"><br>
    性别：<input type="radio" v-model="user.sex" value="0">男
         <input type="radio" v-model="user.sex" value="1">女<br>
    爱好：<input type="checkbox" v-model="user.ah" value="0">读书
         <input type="checkbox" v-model="user.ah" value="1">体育
         <input type="checkbox" v-model="user.ah" value="2">旅游<br>
    国籍:<select v-model="user.gj">
            <option value="0">中国</option>
            <option value="1">俄罗斯</option>
            <option value="2">苏联</option>
        </select><br>
    个人简介：<textarea cols="30" rows="5" v-model="user.grjj"></textarea><br>
    <input type="button" @click="tj" value="提交">
</div>

<script src="../vue.global.js"></script>

<script>
    Vue.createApp({
        data() {
            return{
                user:{
                    yhm:'',
                    mm:'',
                    qrmm:'',
                    sex:0,
                    ah:[],
                    gj:'',
                    grjj:''
                }
            }
        },
        methods:{
            tj(){
                console.log(this.user.ah)
            }
        }
    }).mount('#app')
</script>
</body>
</html>